<?php

class Application_Form_Hafen extends Zend_Form
{

    public function init()
    {
		
    	$this->setName("hafen");
    	$this->setMethod('post');
		 
    	$name = new Zend_Form_Element_Text('name');
    	$name->setLabel('Name:')
		//-> setAttrib ('onChange', $this->setGeo())
		//-> setAttrib ('onChange', setGeo($this))
		//-> setAttrib ('onChange', 'javascript:setGeo('. $name .')')
		//-> setAttrib ('onChange', 'javascript:setGeo('. $name->getName() .');')
    	->setRequired(true);
    	
    	$tiefe = new Zend_Form_Element_Text('tiefe');
    	$tiefe->setLabel('Tiefe (in m):')
    	->addValidator('Alnum', true)
    	->setRequired(true);
    	
    	$ankerplaetze = new Zend_Form_Element_Text('ankerplaetze');
    	$ankerplaetze->setLabel('Anzahl an Ankerplaetzen:')
    	->addValidator('Int', true)
    	->setRequired(true);
    	
    	$typ = new Zend_Form_Element_Select('typ');
    	$typ -> setLabel('Typ:')
    		->setMultiOptions(array(
    			'hafen'=>'Hafen',
    			'bucht'=>'Bucht',
    			'marina'=>'Marina',
    			'reviera'=>'Revieara',	
    		))
    		->setRequired(true);
    	
    	$revier = new Zend_Form_Element_Text('revier');
    	$revier->setLabel('Reviername:');
    	
    	$land = new Zend_Form_Element_Text('land');
    	$land->setLabel('Land:');
// 		-> setAttrib ('onChange', 'javascript:setGeo('. $name->getName() .');');
		//-> setAttrib ('onChange', $this->setGeo());
// 		-> setAttrib ('onChange', 'javascript:setGeo('. $land->getName() .');');

    	$buttonland = new Zend_Form_Element_Button('buttonland');
    	$buttonland->setLabel('auf Karte aktualisieren')
    	->setAttrib('onClick','javascript:setGeo("land");');
    	
    	$stadt = new Zend_Form_Element_Text('stadt');
    	$stadt->setLabel('Stadt:');
// 		-> setAttrib ('onChange', 'javascript:setGeo('. $name->getName() .');');
		//-> setAttrib ('onChange', $this->setGeo());
//     	-> setAttrib ('onChange', 'javascript:setGeo('. $stadt->getName() .');');

    	$buttonstadt = new Zend_Form_Element_Button('buttonstadt');
    	$buttonstadt->setLabel('auf Karte aktualisieren')
    	->setAttrib('onClick','javascript:setGeo("stadt");');
    	
    	$adresse = new Zend_Form_Element_Text('adresse');
    	$adresse->setLabel('Adresse:');
    	
    	$latitude = new Zend_Form_Element_Text('lat');
    	$latitude	->setLabel('latitude:')
    	->setRequired(true);
    	
    	$longitude = new Zend_Form_Element_Text('lng');
    	$longitude	->setLabel('longitude:')
    	->setRequired(true);
    	
    	
    	$tankstelle = new Zend_Form_Element_Select('tankstelle');
    	$tankstelle->setLabel('Tankstelle:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$parken = new Zend_Form_Element_Select('parken');
    	$parken->setLabel('Parken:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$wasser = new Zend_Form_Element_Select('wasser');
    	$wasser->setLabel('Wasser:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$strom = new Zend_Form_Element_Select('strom');
    	$strom->setLabel('Strom:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$toilette = new Zend_Form_Element_Select('toilette');
    	$toilette->setLabel('Toilette:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$dusche = new Zend_Form_Element_Select('dusche');
    	$dusche->setLabel('Dusche:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$reperatur = new Zend_Form_Element_Select('reperatur');
    	$reperatur->setLabel('Reperatur:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$kran = new Zend_Form_Element_Select('kran');
    	$kran->setLabel('Kran:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$slipping = new Zend_Form_Element_Select('slipping');
    	$slipping->setLabel('Slipping:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$supermarkt = new Zend_Form_Element_Select('supermarkt');
    	$supermarkt->setLabel('Supermarkt:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$waescherei = new Zend_Form_Element_Select('waescherei');
    	$waescherei->setLabel('Waescherei:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$travelLift = new Zend_Form_Element_Select('travelLift');
    	$travelLift->setLabel('travel Lift:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$wlan = new Zend_Form_Element_Select('wlan');
    	$wlan->setLabel('WLAN:')
    	->setMultiOptions(array(
    			'0' => 'Nein',
    			'1' => 'Ja',
    	));
    	
    	$weblink = new Zend_Form_Element_Text('weblink');
    	$weblink->setLabel('Weblink:');
    	
//     	$koordinaten = new Zend_Form_Element_Hidden('koordinaten');
//     	$koordinaten->setLabel('Koordinaten:');
    	
//    	$premium = new Zend_Form_Element_Select('premium');
//    	$premium->setLabel('Premiumkunde:')
//    	->setMultiOptions(array(
//    			'0' => 'Nein',
//    			'1' => 'Ja',
//    	));
    	
    	
//     	 $portfoliobild = new Zend_Form_Element_Text('portfoliobild');
//     	$portfoliobild->setLabel('Protfoliobild:')
//     	->setOptions(array('id' => 'fname'))
//     	->setRequired(true);
    	
    	
//     	$aktu = new Zend_Form_Element_Button('aktualisieren');
//     	$aktu->setLabel('Aktualisieren');
    	
    	$submit = new Zend_Form_Element_Submit('submit');
    	$submit->setLabel('Abschicken')
    	->setOptions(array('class' => 'submit'));
    	
    	$this
    		->addElement($name)
    		->addElement($tiefe)
    		->addElement($ankerplaetze)
    		->addElement($typ)
    		->addElement($revier)
    		->addElement($land)
    		->addElement($buttonland)
    		->addElement($stadt)
    		->addElement($buttonstadt)
    		->addElement($latitude)
    		->addElement($longitude)
    		->addElement($tankstelle)
    		->addElement($parken)
    		->addElement($wasser)
    		->addElement($strom)
    		->addElement($toilette)
    		->addElement($dusche)
    		->addElement($reperatur)
    		->addElement($kran)
    		->addElement($slipping)
    		->addElement($supermarkt)
    		->addElement($waescherei)
    		->addElement($travelLift)
    		->addElement($wlan)
    		->addElement($weblink)
    		//->addElement($profilbild)
//     		->addElement($koordinaten)
//    		->addElement($premium)
//     		->addElement($aktu)
    		->addElement($submit);
    }

}

